-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added: [M3-6989] - aria-describedby
to TextField with helper text
#11351
added: [M3-6989] - aria-describedby
to TextField with helper text
#11351
Conversation
@@ -113,7 +113,8 @@ interface InputToolTipProps { | |||
tooltipWidth?: number; | |||
} | |||
|
|||
interface TextFieldPropsOverrides extends StandardTextFieldProps { | |||
interface TextFieldPropsOverrides | |||
extends Omit<StandardTextFieldProps, 'label'> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helps TS in general not having to compare overridden types. While in this case this is just a string and this likely has no impact, it's just good practice.
(label | ||
? convertToKebabCase(label) | ||
: // label could still be an empty string | ||
fallbackId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always making sure we have an ID
aria-describedby
to TextField with helper textaria-describedby
to TextField with helper text
aria-describedby
to TextField with helper textaria-describedby
to TextField with helper text
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hkhalil-akamai That's fair, this one has a role="alert"
attribute which is very much meant for this type of behavior (aka, a validation error injected into the DOM) but could indeed use more context.
see commit 95a8d3e which follows this recommended pattern
95a8d3e
to
fd53887
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud Manager UI test results🔺 3 failing tests on test run #8 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: yarn cy:run -s "cypress/e2e/core/linodes/rebuild-linode.spec.ts,cypress/e2e/core/linodes/rebuild-linode.spec.ts,cypress/e2e/core/linodes/rebuild-linode.spec.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing feedback!
Cloud Manager E2E Run #6931
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6931
|
Run duration | 28m 27s |
Commit |
04f241dc8d: added: [M3-6989] - `aria-describedby` to TextField with helper text (#11351)
|
Committer | Alban Bailly |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
2
|
Pending |
2
|
Skipped |
0
|
Passing |
466
|
View all changes introduced in this branch ↗︎ |
Description 📝
Tiny PR to add better accessibility to the
Textfield
via itshelperText
prop.On screen, it is trivial for a user to see a helper test associated with a field, but this is not necessarily true for someone using a screen reader, since the helper text is a plain paragraph floating under the input, and isn't associated with its relevant interactive element.
Changes 🔄
Preview 📷
How to test 🧪
Prerequisites
Verification steps
Textfield
&HelperText
relationshipAs an Author, before moving this PR from Draft to Open, I confirmed ✅